package com.ship.common.core.enums;

/**
 * 消息类型枚举
 */
public enum MessageTypeEnum {
    MESSAGE_TYPE_1(1L, "新增资源/船运合同合同"),
    MESSAGE_TYPE_2(2L, "合同状态变更"),
    MESSAGE_TYPE_3(3L, "船代合同到期"),
    MESSAGE_TYPE_4(4L, "第三方计量合同到期"),
    MESSAGE_TYPE_5(5L, "加油合同到期"),
    MESSAGE_TYPE_6(6L, "保险合同到期"),
    MESSAGE_TYPE_7(7L, "律师合同到期"),
    MESSAGE_TYPE_8(8L, "船舶经纪人合同到期"),
    MESSAGE_TYPE_9(9L, "换港初次提醒"),
    MESSAGE_TYPE_10(10L, "换港二次提醒"),
    MESSAGE_TYPE_11(11L, "换港最终提醒"),
    MESSAGE_TYPE_12(12L, "换船时间初次提醒"),
    MESSAGE_TYPE_13(13L, "换船时间最终提醒"),
    MESSAGE_TYPE_14(14L, "租入长期船即将到期初次提醒"),
    MESSAGE_TYPE_15(15L, "租入长期船即将到期二次提醒"),
    MESSAGE_TYPE_16(16L, "租入长期船到期提醒"),
    MESSAGE_TYPE_17(17L, "租入长期船过期提醒"),
    MESSAGE_TYPE_18(18L, "巴拿马运河预定提醒"),
    MESSAGE_TYPE_19(19L, "苏伊士运河预定提醒"),
    MESSAGE_TYPE_20(20L, "装载时间确认"),
    MESSAGE_TYPE_21(21L, "船舶空档期优化"),
    MESSAGE_TYPE_22(22L, "方案下发"),
    MESSAGE_TYPE_23(23L, "船运执行任务变更"),
    ;

    private final Long code;
    private final String info;

    MessageTypeEnum(Long code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Long getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static String getValueByCode(int code) {
        for (MessageTypeEnum myEnum : MessageTypeEnum.values()) {
            if (myEnum.getCode() == code) {
                return myEnum.getInfo();
            }
        }
        return null;
    }
}
